<?php
/**
 * ===============================================
 * 版权所有 2019-2050 青岛铁锤科技有限公司，并保留所有权利。
 * 网站地址: http://www.huaxianling.com
 * ===============================================
 * Author: Rag Hu
 * Created Time: 2019/7/10 13:38
 * Modified Time: 2019/7/10 13:38
 * Version: 2.0
 */

namespace App\Modules\Inventory\Repositories;


use App\Modules\Inventory\Validators\SalePurchaseValidator;
use Flower\Core\Repository\Eloquent\BaseRepository;

class SalePurchaseRepository extends BaseRepository
{
    public function model()
    {
        return \App\Models\SalePurchase::class;
    }

    public function validator()
    {
        return SalePurchaseValidator::class;
    }

    /**
     * @param $store_id
     * @param $goods_id
     * @param $goods_name
     * @param $type
     * @param $source
     * @param $count
     */
    public function createSalePurchase($store_id,$goods_id,$goods_name,$type,$source,$count)
    {
        $data = [
            'store_id' => $store_id,
            'goods_id' => $goods_id,
            'goods_name' => $goods_name,
            'type' => $type,
            'source' => $source,
            'count' => $count
        ];

        return $this->create($data);
    }
}